<template>
  <div class="confirmOrder" v-if="orderInfo">
    <div class="address-wrapper" @click="toAddress">
      <i class="iconfont icon-dingwei"></i>
      <div class="address-info">
        <div class="user-info">
          <span class="name">蒯宇</span>
          <span class="phone">18051738997</span>
        </div>
        <div class="address-detail">
          江苏省 苏州市 吴中区 香山花园46幢302
        </div>
      </div>
      <van-icon name="arrow" />
    </div>
    <div class="order-wrapper">
      <div class="order-item">
        <p class="shop-title">
          <img style="width:0.24rem; height:0.24rem" :src="orderInfo.mall_vo.logo">
          <span>{{orderInfo.mall_vo.name}}</span>
        </p>
        <div class="goods">
          <div class="goods-item">
            <van-card :num="orderInfo.goods_vo.goods_number" :price="orderInfo.goods_vo.unit_price/100" :desc="orderInfo.sku_vo.specifications.toString()" :title="orderInfo.goods_vo.goods_name" :thumb="orderInfo.sku_vo.thumb_url" />
          </div>
        </div>
      </div>
    </div>
    <div class="payChannel">
      <van-radio-group v-model="radio">
        <van-cell-group>
          <van-cell icon="wechat" title="微信支付" clickable @click="radio='WEIXIN'">
            <van-radio name="WEIXIN" />
          </van-cell>
          <van-cell icon="alipay" title="支付宝" clickable @click="radio='ALIPAY'">
            <van-radio name="ALIPAY" />
          </van-cell>
        </van-cell-group>
      </van-radio-group>
    </div>
    <van-submit-bar :price="orderInfo.order_price" button-text="立即支付" @submit="onSubmit" />
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      radio: "ALIPAY",
      orderInfo: null
    };
  },
  methods: {
    toAddress() {
      this.$router.push({ path: "/address" });
    },
    onSubmit() {},
    initData() {
      axios.get("/json/confirmOrder").then(res => {
        this.orderInfo = res.data.data;
      });
    }
  },
  created() {
    this.initData();
  }
};
</script>

<style lang="less" scoped>
.address-wrapper:before {
  content: "";
  position: absolute;
  display: inline-block;
  bottom: 0;
  left: 0;
  width: 3.75rem;
  height: 0.02rem;
  background-position: 0 0;
  background-size: 3.75rem 0.02rem;
  background-image: url();
}
.address-wrapper {
  display: flex;
  //   justify-content: space-between;
  position: relative;
  width: 100%;
  margin-bottom: 0.08rem;
  background-color: #fff;
  height: 0.66rem;
  align-items: center;
  .icon-dingwei {
    font-size: 0.2rem;
    margin-left: 0.1rem;
    margin-right: 0.1rem;
  }
  .van-icon-arrow {
    position: absolute;
    right: 0.1rem;
  }
  .user-info {
    margin-bottom: 0.08rem;
    .name {
      font-size: 0.16rem;
      font-weight: 700;
      margin-right: 0.11rem;
    }
  }
}
.order-wrapper {
  margin-top: 0.08rem;
  .order-item {
    .shop-title {
      height: 0.39rem;
      background-color: white;
      display: flex;
      align-items: center;
      img {
        margin: 0 0.13rem;
      }
    }
  }
}
.payChannel {
  margin-top: 0.08rem;
}
</style>

